package com.lxyk.domain;

import com.github.pagehelper.PageInfo;

import java.util.List;

public class PageBean<T>{
    private Integer pages;//总页数
    private Integer total;//总条数
    private Integer pageSize;//每页条数
    private Integer pageNum;//当前页数
    private List<T> list; //数据

    public PageBean() {
    }

    public PageBean(PageInfo pageInfo,List list) {
        this.pages = pageInfo.getPages();
        this.total = (int)pageInfo.getTotal();
        this.pageSize = pageInfo.getPageSize();
        this.pageNum = pageInfo.getPageNum();
        this.list = list;
    }

    public PageBean(Integer pages, Integer total, Integer pageSize, Integer pageNum, List<T> list) {
        this.pages = pages;
        this.total = total;
        this.pageSize = pageSize;
        this.pageNum = pageNum;
        this.list = list;
    }

    public Integer getPages() {
        return pages;
    }

    public void setPages(Integer pages) {
        this.pages = pages;
    }

    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getPageNum() {
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    @Override
    public String toString() {
        return "PageInfo{" +
                "pages=" + pages +
                ", total=" + total +
                ", pageSize=" + pageSize +
                ", pageNum=" + pageNum +
                ", list=" + list +
                '}';
    }
}
